public class Main {
		public static void main(String[] args) 
		{
			int i,sum=0,j,k=0,d=0;
			String n="Java is an Object Oriented programming language";
			char m[]=n.toCharArray();
			String p[]=n.split(" ");
			System.out.println("数组方法实现");
			for(i=0;i<m.length;i++)
			{
				if((m[i]>='a'&&m[i]<='z')||(m[i]>='A'&&m[i]<='Z'))
				{
					sum++;
				}
				if(m[i]==' ') 
				{
					for(j=k;j<i;j++)
					{
						System.out.print(m[j]);
					}
					System.out.println();
					k=i+1;
					d++;
				}
			}
			d++;//因为有两个空格就有三个单词
			System.out.println((float)sum/d);
			System.out.println("字符串实现");
			sum=0;
			for(i=0;i<p.length;i++)
			{
				System.out.println(p[i]);
				char q[]=p[i].toCharArray();
				sum=sum+q.length;
			}	
			System.out.println(((float)sum/p.length));
		}
}